home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 November / PCWorld_2007-11_cd.bin / domácnost a kancelar / opencontacts / setup.exe / {app} / DataSet / Templates / ViewImportTemplate.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2007-08-18  |  2.7 KB  |  91 lines

  1. ∩╗┐<?xml version="1.0" encoding="UTF-8"?>
  2. <!--For basic HTML rendering of QuickView
  3. -->
  4. <xsl:stylesheet version="1.0"
  5. xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  6. <xsl:output method="html" omit-xml-declaration="yes" encoding="UTF-8" />
  7.  
  8.   <xsl:template match="/">
  9.     <html>
  10. <head>
  11. <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  12. </head>
  13.  
  14.       <body>
  15.           <xsl:for-each select="OpenContactsStandardImport/Sections/Section">
  16.             <div style="margin-left: 15px;">
  17.  
  18.  
  19.               <b>
  20.                 <font face="Times New Roman" size="2">
  21.                   <xsl:value-of select="@Name"/>
  22.                 </font>
  23.               </b>
  24.             </div>
  25.  
  26.  
  27.  
  28.             <table border="0" width="100%" id="table1" cellspacing="0" cellpadding="0">
  29.               <xsl:for-each select="Fields/Field">
  30.                 <tr>
  31.                   <td width="15"></td>
  32.                   <td width="80" bgcolor="#C3D9FF">
  33.                     <font face="Times New Roman" size="2">
  34.                       <xsl:value-of select="@Name"/>:
  35.                     </font>
  36.                   </td>
  37.                   <td bgcolor="#E0ECFF">
  38.                     <font size="3">
  39.                       <xsl:value-of select="@Value"/>
  40.                     </font>
  41.                   </td>
  42.                 </tr>
  43.               </xsl:for-each>
  44.  
  45.             </table>
  46.  
  47.             <div style="margin-left: 15px;">
  48.  
  49.               <font size="2" color="#800000">
  50.                 <xsl:apply-templates select="Notes"/>
  51.               </font>
  52.  
  53.  
  54.             </div>
  55.  
  56.           </xsl:for-each>
  57.  
  58.           <p>  </p>
  59.       </body>
  60.     </html>
  61.   </xsl:template>
  62.  
  63.   <xsl:template match="Notes">
  64.       <xsl:call-template name="substitute">
  65.          <xsl:with-param name="string" select="." />
  66.       </xsl:call-template>
  67. </xsl:template>
  68.  
  69.  <xsl:template name="substitute">
  70.    <xsl:param name="string" />
  71.    <xsl:param name="from" select="' '" />
  72.    <xsl:param name="to">
  73.       <p/>
  74.    </xsl:param>
  75.    <xsl:choose>
  76.       <xsl:when test="contains($string, $from)">
  77.          <xsl:value-of select="substring-before($string, $from)" />
  78.          <xsl:copy-of select="$to" />
  79.          <xsl:call-template name="substitute">
  80.             <xsl:with-param name="string"
  81.                             select="substring-after($string, $from)" />
  82.             <xsl:with-param name="from" select="$from" />
  83.             <xsl:with-param name="to" select="$to" />
  84.          </xsl:call-template>
  85.       </xsl:when>
  86.       <xsl:otherwise>
  87.          <xsl:value-of select="$string" />
  88.       </xsl:otherwise>
  89.    </xsl:choose>
  90. </xsl:template>                
  91. </xsl:stylesheet>